<?php
 defined("BASEDIR") or die();
 define("PATH", "../data/");
 
 class Application_Controller_Adm_ChangeLog
 {
	protected $view, $request;
/**
 * Kontruktor
 *
 *
 */
	public function __construct(Application_Router_Standard_Request $request)
	{
		$this->request = $request;
		$this->view = Application_View_ViewEngine::getInstance();
		if($request->show != "")
		{
		
			$actionName = $request->show."Action";
			if(method_exists($this, $actionName))
			{
				$this->$actionName();
				$this->view->assign("module", $request->action."_".$request->show."_admin");
			}
			else
			{
				$this->view->assign("module", $request->action."_admin");
				$this->defaultAction();
			}
		}
		else
		{
		
			$this->view->assign("module", $request->action."_admin");
			$this->defaultAction();
		}
	}
	
/**
 *
 *
 *
 */
	public function defaultAction()
	{
		$filename = "changelog.txt";
		$log = file_get_contents(PATH.$filename);
		$array = explode("\n", $log);
		
		foreach($array as $k => $v)
		{
			if($v[0] != "" && $v[0] != "-") $array[$k] = "<strong>".$v."</strong>";
		}
		
		$log = implode("\n", $array);
		$log = nl2br($log);
		$this->view->assign_by_ref("log", $log);
	}
 }
?>